{namespace lfe=SGalinski\Lfeditor\ViewHelpers}
{namespace core=TYPO3\CMS\Core\ViewHelpers}

<div class="row">
	<div class="col col-md-6">
		<div class="form-group">
			<label>{extensionLabel}</label>
			<div class="input-group">
				<f:form.select additionalAttributes="{class: 'form-control', onChange: 'TYPO3.lfEditor.jump(this)'}">
					<f:for each="{extensions}" as="extension" key="extAddress">
						<optgroup label="{extension.extLabel}">
							<f:for each="{extension.languageFileOptions}" as="langFileLabel" key="langFileOption">
								<f:if condition="{extAddress} == {extensionSelection} && {langFileOption} == {languageFileSelection}">
									<f:then>
										<f:be.menus.actionMenuItem label="{langFileLabel}"
										                           controller="{controllerName}"
										                           action="changeSelection"
										                           arguments="{extensionSelection: extAddress, languageFileSelection: langFileOption}"
										                           additionalAttributes="{selected: 'selected'}" />
									</f:then>
									<f:else>
										<f:be.menus.actionMenuItem label="{langFileLabel}"
										                           controller="{controllerName}"
										                           action="changeSelection"
										                           arguments="{extensionSelection: extAddress, languageFileSelection: langFileOption}" />
									</f:else>
								</f:if>
							</f:for>
						</optgroup>
					</f:for>
				</f:form.select>
				<span class="input-group-btn">
							<button class="btn btn-default"
							        onclick="document.getElementById('refreshLanguageFileListForm').submit();"
							        title="{f:translate(key:'button.refreshLanguageFileList.title')}">
								<core:icon identifier="actions-system-refresh" size="small" />
							</button>
						</span>
			</div>
		</div>
		<f:form id="refreshLanguageFileListForm" action="refreshLanguageFileList"></f:form>
	</div>
</div>
